package com.ruoyi.incident.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.incident.mapper.XlkjIncidentMapper;
import com.ruoyi.incident.domain.XlkjIncident;
import com.ruoyi.incident.service.IXlkjIncidentService;

/**
 * 事件Service业务层处理
 *
 * @author wang
 * @date 2022-01-13
 */
@Service
public class XlkjIncidentServiceImpl implements IXlkjIncidentService
{
    @Autowired
    private XlkjIncidentMapper xlkjIncidentMapper;

    /**
     * 查询事件
     *
     * @param id 事件主键
     * @return 事件
     */
    @Override
    public XlkjIncident selectXlkjIncidentById(Long id)
    {
        return xlkjIncidentMapper.selectXlkjIncidentById(id);
    }

    /**
     * 查询事件列表
     *
     * @param xlkjIncident 事件
     * @return 事件
     */
    @Override
    public List<XlkjIncident> selectXlkjIncidentList(XlkjIncident xlkjIncident)
    {
        return xlkjIncidentMapper.selectXlkjIncidentList(xlkjIncident);
    }

    /**
     * 新增事件
     *
     * @param xlkjIncident 事件
     * @return 结果
     */
    @Override
    public int insertXlkjIncident(XlkjIncident xlkjIncident)
    {
        xlkjIncident.setCreateTime(DateUtils.getNowDate());
        return xlkjIncidentMapper.insertXlkjIncident(xlkjIncident);
    }

    /**
     * 修改事件
     *
     * @param xlkjIncident 事件
     * @return 结果
     */
    @Override
    public int updateXlkjIncident(XlkjIncident xlkjIncident)
    {
        xlkjIncident.setUpdateTime(DateUtils.getNowDate());
        return xlkjIncidentMapper.updateXlkjIncident(xlkjIncident);
    }

    /**
     * 批量删除事件
     *
     * @param ids 需要删除的事件主键
     * @return 结果
     */
    @Override
    public int deleteXlkjIncidentByIds(Long[] ids)
    {
        return xlkjIncidentMapper.deleteXlkjIncidentByIds(ids);
    }

    /**
     * 删除事件信息
     *
     * @param id 事件主键
     * @return 结果
     */
    @Override
    public int deleteXlkjIncidentById(Long id)
    {
        return xlkjIncidentMapper.deleteXlkjIncidentById(id);
    }

    @Override
    public List<XlkjIncident> selectInciByDepartmentId(String[] departmentId) {
        return xlkjIncidentMapper.selectInciByDepartmentId(departmentId);
    }
}
